package com.example.state.machine.service;

import com.example.state.machine.entity.Product;
import org.springframework.transaction.annotation.Transactional;

public interface OrderService {
    // 创建订单（初始状态为 UNPAID）
    Order createOrder(Product product);

    @Transactional
    void payOrder(Long orderId);

    @Transactional
    void shipOrder(Long orderId);

    void receiveOrder(Long orderId);

    @Transactional
    void cancelOrder(Long orderId);

    // 查询订单
    Order getOrder(Long orderId);
}
